﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SSE657.BahMap.DataAccess;
using SSE657.BahMap.Common;

namespace SSE657.BahMap.Domain.Test.Mocks
{
    class MockBAHDataConnector : IBAHDataConnector
    {
        public IEnumerable<RateData> GetAreaRates(PayGrade grade, bool dependents)
        {
            throw new NotImplementedException();
        }

        public double GetRate(PayGrade grade, bool dependents, int zipcode)
        {
            throw new NotImplementedException();
        }

        public double GetRate(PayGrade grade, bool dependents, string MHA)
        {
            throw new NotImplementedException();
        }

        public void GetRateAndRange(PayGrade grade, bool dependents, int zipcode, out double rate, out double min, out double max)
        {
            throw new NotImplementedException();
        }

        public void GetRateAndRange(PayGrade grade, bool dependents, string mha, out double rate, out double min, out double max)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<RateData> GetGradeRates(bool dependents, int zipcode)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<RateData> GetGradeRates(bool dependents, string mha)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<RateData> GetRates(int zipcode)
        {
            if (zipcode > 0)
                return new List<RateData>(new RateData[] { GenerateGoodRateData() });
            else
                return new List<RateData>();
        }

        public IEnumerable<RateData> GetRates(string MHA)
        {
            if (!String.IsNullOrEmpty(MHA))
                return new List<RateData>(new RateData[] { GenerateGoodRateData() });
            else
                return new List<RateData>();
        }

        private RateData GenerateGoodRateData()
        {
            return new RateData()
            {
                Rate = 1000,
                Grade = PayGrade.E1,
                Dependents = false,
                Area = new Area()
                {
                    MHA = "GA079",
                    ZIPs = new List<int>(new int[] { 31210, 31216, 31207, 31206 })
                }
            };
        }
    }
}
